function [array_out] = dat2array(fpath, N, q);
%% For debug mode
% fpath = result_file;
% N = nr*nc;
%%

%Verilog
FILE_OFFSET = 0;

% fid00 = fopen('dt_v2_source_output.out','r');
fid00 = fopen(fpath,'r');

    tgt_out_ver = fscanf(fid00,'%32s\n');

fclose(fid00);

[r,c] = size(tgt_out_ver);

tgt_out_ver1 = tgt_out_ver(FILE_OFFSET+1:FILE_OFFSET+N*6);

% q = quantizer('fixed', [24,8]);

file_array = reshape(tgt_out_ver1, 6, N)';
array_out = hex2num(q, file_array);
